Problem Of the Week: 7th October 2023

There are 100 lockers that line the main hallway of Holyport. Every morning, the security guards make sure that all of the lockers are closed so that there will be an orderly start to the day. One day, 100 mischievous students decide that they will play a prank.

The students all meet after school ends and line up. The first student then walks down the hallway and opens every locker. The next student follows by closing every other locker (starting at the second locker). The third student then goes to every third locker (starting with the third), opens it if it’s closed, and closes it if it’s open. Student 4 follows by opening every fourth locker if it’s closed and closing it if it’s open. This goes on and on until the 100th student finally goes to the hundredth locker. When the security guards arrive the next morning, which lockers must they close?